using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class 物品管理单例<T> : MonoBehaviour where T : 物品管理单例<T>
{
    public static T SingleItemManage;
    
    protected virtual void Awake()
    {
        if (SingleItemManage != null)
        {
            Debug.Log(name + "物品管理单例复用");
            Destroy(gameObject);
        }
        SingleItemManage = (T)this;
        DontDestroyOnLoad(gameObject);
    }
    protected virtual void OnDestroy()
    {
        SingleItemManage = null;
    }


}
